/**
 * @param {string} s1
 * @param {string} s2
 * @return {boolean}
 */
var areAlmostEqual = function (s1, s2) {
  let temp =''
  if (s1 === s2) return true
  const len = s1.length
  let indexArr = []
  for (let i = 0; i < len; i++) {
    if (s1[i] != s2[i]) {
      indexArr.push(i)
      temp+=s1[i]
      if(indexArr.length===2){
        temp+=s2.slice(i+1)
        break
      }
    }else {
      temp+=s2[i]
    }
  }
 
console.log(temp);
 return s1[indexArr[0]]==s2[indexArr[1]]&& s1[indexArr[1]]==s2[indexArr[0]] && s1 ===temp
}

console.log(areAlmostEqual('jbuceoxmpjgrauocx','pbuceoxmjjgrauocx'));


// let a = '123'
// a[0]='b'
// console.log(a);